<?php

use Illuminate\Routing\Router;

Admin::registerAuthRoutes();

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');

    $router->resources([
        'users'                 => UserController::class,
        'departments'           => DepartmentController::class,
        'department/users'      => Department\UserController::class,
        'behavior/cat'          => Behavior\CatController::class,
        'behaviors'             => BehaviorController::class,
        'behavior/image'        => Behavior\ImageController::class,
        'points/setting'        => Points\SettingController::class,
        'points'                => PointsController::class,
        'goods/examine'         => Goods\ExamineController::class,
        'goods/recycle'         => Goods\RecycleController::class,
        'goods'                 => Goods\GoodsController::class,
        'orders'                => OrderController::class,
        'family'                => FamilyController::class,
        'images'                => ImageController::class,
    ]);


    $router->get('api/city',CityController::class.'@city');
    $router->get('api/area',CityController::class.'@area');

    $router->any('points/save',Points\SettingController::class.'@save');

    $router->post('points/updatePoints', PointsController::class.'@updatePoints');

    $router->post('goods/recycle/{id}', Goods\RecycleController::class.'@restore');

    //$router->any('addFamilyUser', FamilyController::class.'@addFamilyUser');


});
